Skip to content

Conversation

@1robie
Copy link
Collaborator

@1robie 1robie commented Jan 27, 2026

This pull request introduces several improvements to version handling and component registration, particularly enhancing compatibility with different Minecraft versions. The most significant changes include adding new version-checking methods, refactoring how variant item components are registered based on version, and improving error handling during initialization.

Version handling and compatibility improvements:

  • Added new methods is1_11OrNewer() and is1_12OrNewer() to the NmsVersion class to enable more granular version checks.
  • Refactored initializeVariantComponents in ZComponentsManager to register variant item components conditionally, based on the current Minecraft version. This ensures only supported components are registered for each version, improving compatibility and reducing errors.

Error handling and logging:

  • Wrapped the call to initializeVariantComponents in a try-catch block, logging errors when initialization fails if debug mode is enabled. This makes debugging easier and prevents crashes during startup.
  • Added import for the custom Logger class to support improved logging.

Threading and plugin state checks:

  • Updated logic in PacketAnimationListener to ensure tasks are only scheduled if the plugin is enabled, and only run immediately if on the primary thread. This prevents potential issues when the plugin is disabled or running asynchronously. [1] [2] [3]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant